package Utils.AutoCreateTable;

/**
 * @author tieyi  2019/12/21 23:03
 * @version 1.0.0
 * @Description: No Description
 * @package Utils.AutoCreateTable
 * @file Flink_UDF_Demo
 */
public enum TableTypes {
    STRING, VARCHAR, CHAR,VARCHAR2,
    INT, MEDIUMINT, TINYINT, DATETIME,
    SMALLINT, BIGINT, DOUBLE, FLOAT,
    BOOLEAN, DATE, TIMESTAMP, DECIMAL;

    public static TableTypes fromString(String type) {
        if(type == null) {
            throw new RuntimeException("null ColumnType!");
        }
        if(type.toUpperCase().startsWith("DECIMAL")) {
            return DECIMAL;
        }

        return valueOf(type.toUpperCase());
    }

}
